class Event{

  on(evt,fn){
    if(typeof this.#listeners[evt]==='undefined'){
      this.#listeners[evt]=[];
    }
    this.#listeners[evt].push(fn);
  }

  emit(evt,arg){
    const fns=this.#listeners[evt];
    for(const fn of fns){
      fn();
    }
  }

#listeners={
 /* 'bark':[fn1,fn2],
  'hello':[fn3,fn4]*/
};
}
module.exports=Event;
